//
//  FindViewController.m
//  LAN
//
//  Created by 陶亮 on 16/1/25.
//  Copyright © 2016年 陶亮. All rights reserved.
//

#import "FindViewController.h"
#import "FindCollectionViewCell.h"
#import "FDDatailViewController.h"//did的详情
#import "FiltrateView.h"
//#import "MoreViewController.h"
//#import "FinfDetailViewController.h"
//#import "LogInViewController.h"
//#import "VitalityViewController.h"

//#define HH  [UIColor colorWithRed:248/255.0 green:233/255.0 blue:112/255.0 alpha:1]
#define DHT [UIColor colorWithRed:248/255.0 green:248/255.0 blue:248/255.0 alpha:1]
@interface FindViewController ()<UICollectionViewDelegate,UICollectionViewDataSource,UIScrollViewDelegate,UITableViewDataSource,UITableViewDelegate,FiltrateViewDelegate>
@property(nonatomic,retain)UICollectionView *myCollectionView;
@property(nonatomic,retain)UIView *myheaderView;
@property(nonatomic,retain)UIButton *goBack;
@property(nonatomic,retain)UIScrollView *BigScrollView;

@property(nonatomic,retain)UIButton *SSbution;
@property(nonatomic,retain)UIButton *HTbutton;
@property(nonatomic,retain)NSMutableArray *myArray;
@property(nonatomic,retain)NSMutableArray *myArray2;
@property(nonatomic,retain)NSMutableArray *buttonArray;
@property(nonatomic,retain)NSMutableArray *buttonArray2;
@property(nonatomic,retain)UIView *tishiView;
@property(nonatomic,assign)BOOL isMore;
@property(nonatomic,assign)BOOL login;
@property(nonatomic,assign)BOOL isSelect;
@property(nonatomic,retain)NSMutableArray *zhiweiArray;
@property(nonatomic,retain)UIView *bigView;

@property(nonatomic,retain)UIView *aView;
@property(nonatomic,retain)UIView *bView;
@property(nonatomic,assign)BOOL isOk;
@property(nonatomic,retain)UITableView *mytableView;
@property(nonatomic,retain)UIView *cView;
@property(nonatomic,retain)UIImageView *LouDouImageView;

@property(nonatomic,retain)UIButton *button;
@property(nonatomic,retain) UIImageView *SJImageView;
@property(nonatomic,retain)UIImageView *sanjiao;



@property (nonatomic,assign)CGFloat selfHeight;
@property (nonatomic,retain)UITableView *tableView;

@end

@implementation FindViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self scrollButton];
    [self navigationAction];
    [self aaa];
    
    
}

- (void)navigationAction{
        self.zhiweiArray =[[NSMutableArray alloc]initWithObjects:@"淘宝平面模特",@"T台模特",@"内衣模特",@"中老年模特",@"童模", nil];
    _isSelect = YES;
    _login = NO;
    self.isOk = NO;
    
    //导航栏
    self.myheaderView = [[UIView alloc]init];
    self.myheaderView.backgroundColor = HH;
    self.myheaderView.userInteractionEnabled = YES;
    UITapGestureRecognizer * tapAction = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(selectAction:)];
    [self.myheaderView addGestureRecognizer:tapAction];
    [self.view addSubview:self.myheaderView];
    [self.myheaderView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.view).offset(0);
        make.size.mas_equalTo(CGSizeMake(self.view.frame.size.width, 139.00*HEIGHT/2));
        
    }];
    
    
    //返回 左边按钮
    self.goBack = [[UIButton alloc]init];
    [self.goBack setImage:[UIImage imageNamed:@"huoyuedu3p90x90-01-01.png"] forState:UIControlStateNormal];
    [self.goBack addTarget:self action:@selector(Back:) forControlEvents:UIControlEventTouchUpInside];
    [self.myheaderView addSubview:self.goBack];
    [_goBack mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.myheaderView).offset(51.00*HEIGHT/2);     //  相对于self.view 顶部 10
        make.left.equalTo(self.myheaderView).offset(20.00*WEIGHT/2);    //  相对于self.view 左边 10
        make.size.mas_equalTo(CGSizeMake(34.00*HEIGHT, 34.00*HEIGHT));
        
    }];
    
    
    
    //右边按钮
    self.SSbution = [[UIButton alloc]init];
    [self.SSbution setImage:[UIImage imageNamed:@"sousuo3p-01-01.png"] forState:UIControlStateNormal];
    [self.SSbution addTarget:self action:@selector(souSuo:) forControlEvents:UIControlEventTouchUpInside];
    [self.myheaderView addSubview:self.SSbution];
    [self.SSbution mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.myheaderView).offset(51.00*HEIGHT/2);     //  相对于self.view 顶部 10
        make.right.equalTo(self.myheaderView).offset(-20.00*WEIGHT/2);    //  相对于self.view 左边 10
        make.size.mas_equalTo(CGSizeMake(34.00*HEIGHT, 34.00*HEIGHT));
        
    }];
    
    
    /*
//    //标题
//    UILabel *title = [UILabel new];
//    title.text = @"淘宝平面模特";
//    title.font = [UIFont systemFontOfSize:17.00*HEIGHT];
//    title.adjustsFontSizeToFitWidth = YES;
//    title.textColor = HS;
//    title.textAlignment = UITextAlignmentCenter;
//    title.textColor = [UIColor blackColor];
//    [self.myheaderView addSubview:title];
//    [title mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(self.myheaderView).offset(66.00*HEIGHT/2);
//        make.left.equalTo(self.myheaderView).offset((self.view.frame.size.width - 100.00*WEIGHT)/2);
//        make.size.mas_equalTo(CGSizeMake(100.00*WEIGHT,20.00*HEIGHT));
//    }];
//    

    
//    //添加的三角
//    self.SJImageView = [[UIImageView alloc]init];
//    UITapGestureRecognizer *SStap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(souSuo:)];
//    //self.SJImageView.backgroundColor = [UIColor blackColor];
//    [self.SJImageView  addGestureRecognizer:SStap];
//    self.SJImageView .image = [UIImage imageNamed:@"30x22@2p-01.png"];
//    [self.myheaderView addSubview:self.SJImageView ];
//    [self.SJImageView  mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(self.myheaderView).offset(74.00*HEIGHT/2);
//        make.left.equalTo(title.mas_right).offset(5.00*WEIGHT);
//        make.size.mas_equalTo(CGSizeMake(30.00*HEIGHT/2,22.00*HEIGHT/2));
//        
//
//        
//    }];
//

    
    */
}

- (void)scrollButton{
    self.aView = [[UIView alloc]init];

    self.aView.frame = CGRectMake(0, 139.00*HEIGHT/2, self.view.frame.size.width - 114.00*WEIGHT/2, 40.00*HEIGHT);

    self.aView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:self.aView];
    
    
    
    self.bView = [[UIView alloc]init];
     self.bView.frame = CGRectMake(0,139.00*HEIGHT/2 , self.view.frame.size.width, 40.00*HEIGHT);
    self.bView.backgroundColor = [UIColor whiteColor];
    self.bView.alpha  = 0;
    [self.view addSubview:self.bView];

    
    
    
    self.cView = [[UIView alloc]init];
    self.cView.backgroundColor = DHT;
       self.cView.frame = CGRectMake(self.view.frame.size.width - 114.00*WEIGHT/2, 139.00*HEIGHT/2, self.view.frame.size.width +114.00*WEIGHT/2, 40.00*HEIGHT);
    [self.view addSubview:self.cView];

    UILabel *line = [[UILabel alloc]init];
    line.backgroundColor = HS;
    line.alpha = 0.0;
    [self.cView addSubview:line];
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.cView).offset(0);
       // make.left.equalTo(self.cView.left).offset(1);
        make.left.equalTo(self.cView.mas_left).offset(1);
        make.bottom.equalTo(self.cView).offset(0);
        make.size.mas_equalTo(CGSizeMake(1, 40.00*HEIGHT));
        
    }];
    
    UIImageView *imageView1 = [[UIImageView alloc]initWithFrame:CGRectMake(0.00*HEIGHT, 5.00*WEIGHT, 2.00*HEIGHT, 30.00*HEIGHT)];
    [self.cView addSubview:imageView1];

    
    
    UIGraphicsBeginImageContext(imageView1.frame.size);   //开始画线
    [imageView1.image drawInRect:CGRectMake(0, 0, 2, 30.00*HEIGHT)];
    imageView1.alpha = 0.5;
    CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);  //设置线条终点形状
    
    
    CGFloat lengths[] = {2,1};
    CGContextRef Hline = UIGraphicsGetCurrentContext();
    CGContextSetStrokeColorWithColor(Hline, [UIColor blackColor].CGColor);

    CGContextSetLineDash(Hline, 0, lengths, 2);  //画虚线
    CGContextMoveToPoint(Hline, 0.0, 5.0);    //开始画线
    CGContextAddLineToPoint(Hline, 0.0, 30.00*HEIGHT);
    CGContextStrokePath(Hline);
    imageView1.image = UIGraphicsGetImageFromCurrentImageContext();
    
    
    UITapGestureRecognizer *donghua = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(donghuaAction:)];
    self.cView.userInteractionEnabled = YES;
    [self.cView addGestureRecognizer:donghua];
    self.LouDouImageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"shuangxuan-3p-01.png"]];
    _LouDouImageView.backgroundColor = DHT;
    [self.cView addSubview:_LouDouImageView];
    [_LouDouImageView mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.cView).offset(20.00*HEIGHT/2);
        make.left.equalTo(self.cView).offset(37.00*WEIGHT/2);
        make.size.mas_equalTo(CGSizeMake(20.00*WEIGHT, 20.00*WEIGHT));
    }];
    
    self.aView.backgroundColor = DHT;
    self.bView.backgroundColor = DHT;
    self.cView.backgroundColor = DHT;
    
    
    
   
    self.myArray = [NSMutableArray arrayWithObjects:@"推荐",@"最新",@"最热",nil];
    self.myArray2 = [NSMutableArray arrayWithObjects:@"报酬",@"身高",@"性别",nil];

    self.BigScrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 139.00*HEIGHT/2, self.view.frame.size.width, self.view.frame.size.width)];

    
    
    self.buttonArray =[NSMutableArray array];
    for (int  i = 0; i < self.myArray.count; i ++) {
        UIButton *bbbbbbb = [UIButton buttonWithType:UIButtonTypeCustom];
        bbbbbbb.tag = 1000 + i;
        
        bbbbbbb.frame = CGRectMake((self.view.frame.size.width-114.00*HEIGHT/2)/3*i, 0.00*HEIGHT/2, (self.view.frame.size.width-114.00*HEIGHT/2)/3, 40.00*HEIGHT);
        [bbbbbbb setTitle:self.myArray[i] forState:UIControlStateNormal];
        [bbbbbbb setFont:[UIFont fontWithName:@"Arial" size:15.00*HEIGHT]];
        [bbbbbbb setTitleColor:HS forState:UIControlStateNormal];
        [bbbbbbb addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];
        [self.aView addSubview:bbbbbbb];
        [self.buttonArray addObject:bbbbbbb];
        if (i == 0) {
            [bbbbbbb setTitleColor:[UIColor colorWithRed:244/255.0 green:90/255.0 blue:95/255.0 alpha:1] forState:UIControlStateNormal];
           [ bbbbbbb setFont:  [UIFont fontWithName:@"Arial" size:17.00*HEIGHT]];
            
        }
    }
    self.buttonArray2 =[NSMutableArray array];

    for (int  i = 0; i < self.myArray2.count; i ++) {
        UIButton *bbbbbbb = [UIButton buttonWithType:UIButtonTypeCustom];
        bbbbbbb.tag = 2000 + i;
        
        bbbbbbb.frame = CGRectMake((self.view.frame.size.width-114.00*HEIGHT/2)/3*i, 0.00*HEIGHT/2, (self.view.frame.size.width-114.00*HEIGHT/2)/3, 40.00*HEIGHT);
        [bbbbbbb setTitle:self.myArray2[i] forState:UIControlStateNormal];
        [bbbbbbb setFont:[UIFont fontWithName:@"Arial" size:15.00*HEIGHT]];
        [bbbbbbb setTitleColor:HS forState:UIControlStateNormal];
        [bbbbbbb addTarget:self action:@selector(buttonAction2:) forControlEvents:UIControlEventTouchUpInside];
        [self.bView addSubview:bbbbbbb];
        [self.buttonArray2 addObject:bbbbbbb];
    }
 
    self.BigScrollView = [[UIScrollView alloc]init];
    [self.view addSubview:self.BigScrollView];
    self.BigScrollView.contentSize = CGSizeMake(self.view.frame.size.width *self.myArray.count, self.view.frame.size.height);
    self.BigScrollView.backgroundColor = LV;
    self.BigScrollView.pagingEnabled = YES;
    [self.BigScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.aView.mas_bottom).offset(0);
        make.size.mas_equalTo(CGSizeMake(self.view.frame.size.width, self.view.frame.size.height));
        
    }];
    
    
//
    [self createUICollection];

   }



//
//-(void)moreAction:(UIButton *)more{
    
  /*
    //layer层动画
//    CATransition *transition = [CATransition animation];
//    //设置动画类型
//    [transition setType:@"rippleEffect"];
//    [transition setDuration:2];
//    [transition setRepeatCount:1];
//    //动画结束后是否回到原来位置
//    [transition setAutoreverses:NO];
//    [self.myCollectionView.layer addAnimation:transition forKey:@"transition"];
    
    
    
    */
    
//    MoreViewController *moreVC = [[MoreViewController alloc]init];
//    [self.navigationController pushViewController:moreVC animated:NO];
//  
//    
//}

-(void)donghuaAction:(UITapGestureRecognizer *)click{
   
    if (!self.isOk) {
        
        NSLog(@"1111111");
        
        
        
        [UIView animateWithDuration:0.5 animations:^{
            

            self.cView.frame = CGRectMake(0, 139.00*HEIGHT/2, self.view.frame.size.width , 40.00*HEIGHT);
            
            
            
            self.bView.frame = CGRectMake(0,139.00*HEIGHT/2 , 0, 40.00*HEIGHT);
            self.bView.alpha = 0;
            
            self.aView.frame = CGRectMake(0, 139.00*HEIGHT/2, self.view.frame.size.width - 114.00*WEIGHT/2, 40.00*HEIGHT);
            
            self.aView.alpha = 1;
        } completion:^(BOOL finished) {
            self.aView.alpha = 0;

            [UIView animateWithDuration:0.5 animations:^{
                
                self.cView.frame = CGRectMake(self.view.frame.size.width - 114.00*WEIGHT/2, 139.00*HEIGHT/2, self.view.frame.size.width , 40.00*HEIGHT);
                

                self.bView.frame = CGRectMake(0,139.00*HEIGHT/2 , self.view.frame.size.width - 114.00*WEIGHT/2, 40.00*HEIGHT);
                self.aView.frame = CGRectMake(0, 139.00*HEIGHT/2, 0, 40.00*HEIGHT);
                
                self.bView.alpha = 1;
                
                
                
                self.LouDouImageView.image = [UIImage imageNamed:@"60x60-01(1).png"];
            }];
            
        }];
        
    }
    
    else {
        NSLog(@"22222");
        
        [UIView animateWithDuration:0.5 animations:^{
            

            self.cView.frame = CGRectMake(0, 139.00*HEIGHT/2, self.view.frame.size.width , 40.00*HEIGHT);

            self.aView.frame = CGRectMake(0, 139.00*HEIGHT/2, 0, 40.00*HEIGHT);
           
            self.aView.alpha = 0 ;

            self.bView.frame = CGRectMake(0,139.00*HEIGHT/2 , self.view.frame.size.width - 114.00*WEIGHT/2, 40.00*HEIGHT);
      
        
        } completion:^(BOOL finished) {
            [UIView animateWithDuration:0.5 animations:^{
                

                self.cView.frame = CGRectMake(self.view.frame.size.width - 114.00*WEIGHT/2, 139.00*HEIGHT/2, self.view.frame.size.width , 40.00*HEIGHT);
                self.aView.alpha = 1;
                self.aView.frame = CGRectMake(0, 139.00*HEIGHT/2, self.view.frame.size.width - 114.00*WEIGHT/2, 40.00*HEIGHT);
                self.bView.frame = CGRectMake(self.view.frame.size.width - 114.00*WEIGHT/2,139.00*HEIGHT/2 , 0, 40.00*HEIGHT);
                
                self.bView.alpha = 0;
             
                self.LouDouImageView.image = [UIImage imageNamed:@"shuangxuan-3p-01.png"];
            }];
            
        }];
        
        
    }
    self.isOk =! self.isOk;
    

        
        
}




-(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{

    if (scrollView == self.BigScrollView) {
        for (int i = 0; i < self.buttonArray.count; i++) {
            UIButton * button = [self.buttonArray objectAtIndex:i];
            [button setTitleColor:[UIColor colorWithRed:89/255.0 green:88/255.0 blue:83/255.0 alpha:1] forState:UIControlStateNormal];
            [button setFont:  [UIFont systemFontOfSize:HEIGHT*15.00]];
           
        }
            UIButton * button = [self.buttonArray objectAtIndex:self.BigScrollView.contentOffset.x/self.view.frame.size.width];
            
            [button setTitleColor:[UIColor colorWithRed:244/255.0 green:90/255.0 blue:95/255.0 alpha:1] forState:UIControlStateNormal];
            [button setFont:[UIFont systemFontOfSize:HEIGHT*17.00]];
        
    }
}
-(void)buttonAction:(UIButton *)button{
    NSLog(@"dddd");
    for (int i = 0 ; i < self.myArray.count; i++) {
        UIButton *bbb = [self.buttonArray objectAtIndex:i];
        [bbb setTitle:[self.myArray objectAtIndex:i ] forState:UIControlStateNormal];
//        [button setBackgroundColor: [UIColor colorWithRed:0.984 green:0.935 blue:0.950 alpha:1.000]];
        [bbb setTitleColor:[UIColor colorWithRed:89/255.0 green:88/255.0 blue:83/255.0 alpha:1] forState:UIControlStateNormal];
        [bbb setFont:[UIFont systemFontOfSize:15.00*HEIGHT] ];
    }
    [button setTitleColor:[UIColor colorWithRed:244/255.0 green:90/255.0 blue:95/255.0 alpha:1] forState:UIControlStateNormal];
//    [self.HTbutton setBackgroundColor:[UIColor colorWithRed:0.984 green:0.935 blue:0.950 alpha:1.000]];
   [button setFont:[UIFont systemFontOfSize:17.00*HEIGHT]];
    if (button.frame.origin.x == 0 || button.frame.origin.x ==self.view.frame.size.width-114.00*HEIGHT/2 || button.frame.origin.x == (self.view.frame.size.width-114.00*HEIGHT/2)*2|| button.frame.origin.x == 3*(self.view.frame.size.width-114.00*HEIGHT/2) ) {
//        [self.smallScrollView setContentOffset:CGPointMake(0, 0) animated:YES];
    }

    [self.BigScrollView setContentOffset:CGPointMake((button.tag - 1000) * self.view.frame.size.width, 0) animated:YES];
    
}
-(void)buttonAction2:(UIButton *)button{
    NSLog(@"2222");
    for (int i = 0 ; i < self.myArray2.count; i++) {
        UIButton *bbb = [self.buttonArray2 objectAtIndex:i];
        [bbb setTitle:[self.myArray2 objectAtIndex:i ] forState:UIControlStateNormal];
        //        [button setBackgroundColor: [UIColor colorWithRed:0.984 green:0.935 blue:0.950 alpha:1.000]];
        [bbb setTitleColor:[UIColor colorWithRed:89/255.0 green:88/255.0 blue:83/255.0 alpha:1] forState:UIControlStateNormal];
        [bbb setFont:[UIFont systemFontOfSize:15.00*HEIGHT] ];
    }
    [button setTitleColor:[UIColor colorWithRed:244/255.0 green:90/255.0 blue:95/255.0 alpha:1] forState:UIControlStateNormal];
    //    [self.HTbutton setBackgroundColor:[UIColor colorWithRed:0.984 green:0.935 blue:0.950 alpha:1.000]];
    [button setFont:[UIFont systemFontOfSize:17.00*HEIGHT]];
    if (button.frame.origin.x == 0 || button.frame.origin.x ==self.view.frame.size.width-114.00*HEIGHT/2 || button.frame.origin.x == (self.view.frame.size.width-114.00*HEIGHT/2)*2|| button.frame.origin.x == 3*(self.view.frame.size.width-114.00*HEIGHT/2) ) {
//        [self.smallScrollView setContentOffset:CGPointMake(0, 0) animated:YES];
    }
 
    [self.BigScrollView setContentOffset:CGPointMake((button.tag - 1000) * self.view.frame.size.width, 0) animated:YES];
    
}

#pragma mark - UICollectionView


- (void)createUICollection{
    UICollectionViewFlowLayout *flouLayOut = [[UICollectionViewFlowLayout alloc]init];
    flouLayOut.itemSize = CGSizeMake((self.view.frame.size.width - 10.00*WEIGHT*2), 415.00*HEIGHT/2);
    // flouLayOut.sectionInset = UIEdgeInsetsMake(13.00*HEIGHT/2, 5.00*WEIGHT/2, 5.00*HEIGHT, 5.00*WEIGHT/2);
    self.myCollectionView = [[UICollectionView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height-290*HEIGHT/2) collectionViewLayout:flouLayOut];
    [ self.myCollectionView registerClass:[FindCollectionViewCell class ] forCellWithReuseIdentifier:@"cell"];
    self.myCollectionView.delegate = self;
    self.myCollectionView.dataSource = self;
    
    self.myCollectionView.backgroundColor = LV;
    self.BigScrollView.delegate = self;
    [self.BigScrollView addSubview:self.myCollectionView];
    
}


- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
    return 3;
    
}
 - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
     static NSString *cellStr = @"cell";
     FindCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:cellStr forIndexPath:indexPath];
     
     
     
     
     return cell;
     
     
    
}

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
    NSLog(@"点击了cell");
    FDDatailViewController *FDVC = [FDDatailViewController new];
    

    [self.navigationController pushViewController:FDVC animated:YES];
   // self.navigationController.navigationBar.barTintColor
    
}








//
//-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
//    NSLog(@"iiiii=%ld",(long)indexPath.row);
//   
//    FinfDetailViewController *detailVC = [[FinfDetailViewController alloc]init];
//    detailVC.type = @"0";
//        [self.navigationController pushViewController:detailVC animated:YES];
//  
//    
//    
//    
//}

//  点击 headerView
-(void)selectAction:(UITapGestureRecognizer *)go{
    
        NSLog(@"333r3333");
}


/*
//当有一个或多个手指触摸事件在当前视图或window窗体中响应
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    NSSet *allTouches = [event allTouches];    //返回与当前接收者有关的所有的触摸对象
    UITouch *touch = [allTouches anyObject];   //视图中的所有对象
    CGPoint point = [touch locationInView:[touch view]]; //返回触摸点在视图中的当前坐标
    int x = point.x;
    int y = point.y;
    //    NSLog(@"touch (x, y) is (%d, %d)", x, y);
    if (x >= 0 && x <= 96.00*WEIGHT && y >= 0 && y <= 67.00*HEIGHT) {
        NSLog(@"sssssssss");
        
        
    }
    
    if (x >= 97.00*WEIGHT && x <= 289.00*WEIGHT && y >= 0 && y <= 67.00*HEIGHT) {
        NSLog(@"sjsjjssjsjsjsj");
        NSLog(@"&&&&&&&+%d",_isOk);
//        self.bigView =[[UIView alloc]initWithFrame:CGRectMake(0, self.myheaderView.frame.size.height, self.view.frame.size.width, self.view.frame.size.height-self.myheaderView.frame.size.height)];
//        self.bigView.backgroundColor = HS;
//        self.bigView.alpha = 0.4;
//        self.bigView.hidden = YES;
        if (self.isSelect) {
            
            [self.view addSubview:self.bigView];


           //黄色版
            self.tishiView = [[UIView alloc]init];
            _tishiView.backgroundColor = HH;
            self.tishiView.layer.cornerRadius = 5.00;
            self.tishiView.layer.masksToBounds = YES;
            self.tishiView.layer.borderColor = [CELL CGColor];
            self.tishiView.layer.borderWidth = 0.4;
            [self.view addSubview:self.tishiView];
            self.SJImageView.image =[UIImage imageNamed:@"45x33@3p-01.png"];
           
            [_tishiView mas_makeConstraints:^(MASConstraintMaker *make) {
                
                make.top.equalTo(self.myheaderView.mas_bottom).offset(0);
                make.left.equalTo(self.view).offset((self.view.frame.size.width - 368.00*WEIGHT/2)/2);
                make.right.equalTo(self.view.mas_right).offset(-(self.view.frame.size.width - 368.00*WEIGHT/2)/2);

                make.height.mas_equalTo(300 * AUTO_HEIGHT /2);
            }];
            
            
            
            //白色三角
            self.sanjiao =[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"33x57@3p.png"]];
            [self.view addSubview: self.sanjiao];
            [ self.sanjiao mas_makeConstraints:^(MASConstraintMaker *make) {
                make.top.equalTo(self.myheaderView.mas_bottom).offset(-8.00*HEIGHT);
                make.left.equalTo(self.view).offset(self.view.frame.size.width/2-38.00*WEIGHT/4);
            }];
            
            
            
            
            UIScrollView *yy=[[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, 368.00*WEIGHT/2, 300.00*HEIGHT/2)];
            yy.contentSize = CGSizeMake(0, self.zhiweiArray.count *(50.00*HEIGHT+10.00*HEIGHT));
            
            yy.backgroundColor = [UIColor whiteColor];
            [self.tishiView addSubview:yy];
            for (int i = 0 ; i <  self.zhiweiArray.count; i++) {
                UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
                button.layer.masksToBounds = YES;
                button.layer.borderColor = [CELL CGColor];
                button.layer.borderWidth = 0.4;
                button.layer.cornerRadius = 5.00;
                button.frame = CGRectMake(0,  50.00*i, 368.00*WEIGHT/2, 100.00*HEIGHT/2);
                
                button.tag = 1000 + i;
                [button addTarget:self action:@selector(buttonSelect:) forControlEvents:UIControlEventTouchUpInside];
                if (button.tag == 1000) {
                    NSLog(@"ddddd");
                    button.tintColor = HH;
                }
                button.backgroundColor = [UIColor whiteColor];
                button.alpha = 1;
                [button setTitleColor:ZITI forState:UIControlStateNormal];
                [button setTitle:self.zhiweiArray[i] forState:UIControlStateNormal];
                
                [yy addSubview:button];
             
          
            }
            
            
            
            
          
            self.myCollectionView.alpha = 0.6;
            
            
            
            
            
//            self.smallScrollView.alpha = 0.6;
        }
        
       
        
        else {
            self.tishiView.hidden = YES;
            self.myCollectionView.alpha = 1.0;
//            self.smallScrollView.alpha = 1.0;
            self.sanjiao.hidden = YES;
            self.SJImageView .image = [UIImage imageNamed:@"30x22@2p-01.png"];
        
        }
        

        self.isSelect =! self.isSelect;
        
    }
    
  
    
    
    if (x >= 289.00*WEIGHT && y >= 0 && y <= 67.00*HEIGHT) {
        NSLog(@"ggggggggggg");
        
        
    }
    
    
    
             
    
    
    
    
}

 
 

- (void)buttonSelect:(UIButton*)btu{
    [self.zhiweiArray removeAllObjects];
    if (btu.tag == 1000) {
        NSLog(@"vvvvvvv");
    }
    if (btu.tag == 1001) {
        NSLog(@"bbbbbbb");
    }
    if (btu.tag == 1002) {
        NSLog(@"fffff");
    }
    if (btu.tag == 1003) {
        NSLog(@"儿童");
    }
    
}

*/





- (void)aaa{
    NSArray *titleArr = @[@"淘宝平面模特",];
    NSArray *firstDataArr = @[@"淘宝平面模特",@"T台模特",@"内衣模特",@"中老年模特",@"童模"];
   // NSArray *secondDataArr = @[@"郑州",@"上海",@"北京",@"中牟"];
    //NSArray *thirdDataArr = @[@"100",@"200",@"300",];
    NSArray *dataArr = @[firstDataArr];
    
    
    FiltrateView *filtreteView = [[FiltrateView alloc]initWithCount:1 withTitleArr:titleArr withDataArr:dataArr];
    
    filtreteView.frame = CGRectMake(150, 20, SCREEN_WIDTH/3, 44);
    filtreteView.delegate = self;
    filtreteView.backgroundColor = HH;
    [self.view addSubview:filtreteView];
    
    
    

}





-(void)Back:(UITapGestureRecognizer *)ttt{
    
 //   VitalityViewController *vitalityVC = [[VitalityViewController alloc]init];
   // [self.navigationController pushViewController:vitalityVC animated:YES];
    
    NSLog(@"ssssssssss");
}
//title 右上角
-(void)souSuo:(UITapGestureRecognizer *)sou{
    
    NSLog(@"ggggggggg");
    
}
-(void)scrollViewWillBeginDragging:(UIScrollView *)scrollView{

    self.tishiView.hidden = YES;
    self.myCollectionView.alpha = 1;
//    self.smallScrollView.alpha = 1;
}



-(void)notice:(NSNotificationCenter *)defaults{
    
    _login = YES;
//    self.tabBarController.tabBar.hidden = NO;
    self.navigationController.navigationBarHidden = YES;

    
}
-(void)viewWillAppear:(BOOL)animated{
    self.tabBarController.tabBar.hidden = NO;

    self.navigationController.navigationBarHidden = YES;
    
    }


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
